/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2025 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include <stdio.h>
#include <string.h>
/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */
extern volatile uint8_t stop_flag;
/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */
extern int8_t Encoder_Overflow_Count;
/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */
int GetSensorValue(void);
/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
#define CS5530_CS_2_Pin GPIO_PIN_1
#define CS5530_CS_2_GPIO_Port GPIOC
#define CS5530_SDO_2_Pin GPIO_PIN_2
#define CS5530_SDO_2_GPIO_Port GPIOC
#define CS5530_SDI_2_Pin GPIO_PIN_3
#define CS5530_SDI_2_GPIO_Port GPIOC
#define RUN_LED_Pin GPIO_PIN_12
#define RUN_LED_GPIO_Port GPIOB
#define CS5530_CLK_2_Pin GPIO_PIN_13
#define CS5530_CLK_2_GPIO_Port GPIOB
#define BEEP_Pin GPIO_PIN_14
#define BEEP_GPIO_Port GPIOB
#define PIN_8D_Pin GPIO_PIN_1
#define PIN_8D_GPIO_Port GPIOD
#define PIN_6D_Pin GPIO_PIN_3
#define PIN_6D_GPIO_Port GPIOD
#define PIN_7D_Pin GPIO_PIN_4
#define PIN_7D_GPIO_Port GPIOD
#define PIN_1D_Pin GPIO_PIN_7
#define PIN_1D_GPIO_Port GPIOD
#define PIN_2D_Pin GPIO_PIN_9
#define PIN_2D_GPIO_Port GPIOG
#define PIN_3D_Pin GPIO_PIN_10
#define PIN_3D_GPIO_Port GPIOG
#define PIN_4D_Pin GPIO_PIN_11
#define PIN_4D_GPIO_Port GPIOG
#define PIN_5D_Pin GPIO_PIN_12
#define PIN_5D_GPIO_Port GPIOG
#define CS5530_CLK_1_Pin GPIO_PIN_3
#define CS5530_CLK_1_GPIO_Port GPIOB
#define CS5530_SDO_1_Pin GPIO_PIN_4
#define CS5530_SDO_1_GPIO_Port GPIOB
#define CS5530_SDI_1_Pin GPIO_PIN_5
#define CS5530_SDI_1_GPIO_Port GPIOB
#define CS5530_CS_1_Pin GPIO_PIN_6
#define CS5530_CS_1_GPIO_Port GPIOB
#define PIN_9D_Pin GPIO_PIN_8
#define PIN_9D_GPIO_Port GPIOB
#define PIN_10D_Pin GPIO_PIN_9
#define PIN_10D_GPIO_Port GPIOB

/* USER CODE BEGIN Private defines */
// 版本号
#define VERSION 1
/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */
